<template>
  <div>
      <div v-if="goodsList.length===0">暂无数据</div>
    <router-link
      :to="'/detail/'+item.id"
      class="item"
      v-for="(item,index) in goodsList"
      :key="index"
    >
      <h4>{{item.goodsname}}</h4>
      <div>价格：{{item.price|filterPrice}}</div>
      <!-- ??????????http://localhost:3000,开发要加，打包不加??????????????????????????????????????????????? -->
      <img :src="$pre+item.img" alt="">
    </router-link>
  </div>
</template>

<script>
export default {
props:["goodsList"]
}
</script>

<style scoped>
.item {
  display: block;
  margin: 0.2rem;
  background: pink;
}
img{
  width: 1rem;
  height:1rem;
}
</style>